package org.test.pong.controller

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.http.ResponseEntity
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.MvcResult
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders
import org.springframework.test.web.servlet.result.MockMvcResultHandlers
import reactor.core.publisher.Mono
import spock.lang.Specification

@SpringBootTest
@AutoConfigureMockMvc
class PongControllerTest extends Specification{

    @Autowired
    private MockMvc mockMvc;
    //test method
    def "test pong controller"(){

        when:
        for (i in 0..<2) {
            MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get("/pong")).andReturn()
        }
        then:
        println("done")

    }

}
